#include "ptmr.h"
#include <stdint.h>

uint32_t sys_timestamp = 0;

void sys_time_set(uint32_t* time)
{
	if(system_tick_ms == 0)
	{
		*time = 1;
		return;
	}
	*time = system_tick_ms;
}

void update_timestamp(void)
{
	static uint32_t timestamp = 0;
	if(system_tick_ms % 1000 == 0)
	{
		if(sys_timestamp == timestamp)
		{
			sys_timestamp++;
		}
		timestamp = sys_timestamp;
	}
}
